<template>
	<view
		style="width: 100%;  background-color: 	#F5F5F5;height: 100%;
	display: flex;
	align-items: center;
	flex-direction: column;
	"
	>
		<view class="pageaddress">
			<view style="height: 50%; display: flex; align-items: center;justify-content: space-between; border: 1px solid #F5F5F5;">
				<view class="place">
					<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
					<text style="margin-left: 5px;font-size:15px;">装货地</text>
				</view>
				<!-- 地区选择 -->
				<view style="display: flex;margin-right: 15px; justify-content: space-between;" @click="openAddres2">
					<input type="text" style="width:170px ; margin-right: 8px;text-align: right;font-size:15px" placeholder="请选择地址" disabled="disabled" v-model="city" />
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>

				<!-- 地区选择完 -->
			</view>
			<view style="height: 50%; display: flex; align-items: center;justify-content: space-between; border: 1px solid #F5F5F5;">
				<view class="place">
					<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
					<text style="margin-left: 5px;font-size:15px;">装货地</text>
				</view>
				<!-- 地区选择 -->
				<view style="display: flex;margin-right: 15px; justify-content: space-between;">
					<input type="text" style="width:170px ; margin-right: 8px;text-align: right;font-size:15px" v-model="zhuang" placeholder="请输入详细地址" />
					<picker
						class="Choice"
						:range="loading"
						@change="loadinged"
						style="width: 25px; 
							color: #FFFFFF;
							  z-index: 2;
							height: 25px;
							  overflow: hidden;
							 white-space: nowrap;
							  text-overflow: ellipsis;
							"
					>
						<image src="../../static/img/icon_dingzhi@2x.png" mode="" style="width: 25px;height: 25px;"></image>
						<text style="opacity: 0;">{{ loading[loadings] }}</text>
					</picker>
				</view>
			</view>
		</view>
		<!-- 卸货地 -->
		<view class="pageaddress">
			<view style="height: 50%; display: flex; align-items: center;justify-content: space-between; border: 1px solid #F5F5F5;">
				<view class="place">
					<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
					<text style="margin-left: 5px;font-size:15px;">卸货地</text>
				</view>
				<!-- 地区选择 -->
				<view style="display: flex;margin-right: 15px; justify-content: space-between;" @click="openAddres3">
					<input type="text" style="width:170px ; margin-right: 8px;text-align: right;font-size:15px" placeholder="请选择地址" disabled="disabled" v-model="citys" />
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>

				<!-- 地区选择完 -->
			</view>
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;">
				<view class="place">
					<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
					<text style="margin-left: 5px;font-size:15px;">卸货地</text>
				</view>
				<!-- 下拉框 -->
				<view style="display: flex;margin-right: 15px; ">
					<input type="text" style="width:170px ; margin-right: 8px;text-align: right;font-size:15px" v-model="xie" placeholder="请输入详细地址" />
					<picker
						class="Choice"
						:range="unloading"
						@change="unload"
						style="width: 25px;
								height: 25px;
								 overflow: hidden;
								 white-space: nowrap;
								   text-overflow: ellipsis;
								"
					>
						<image src="../../static/img/icon_dingzhi@2x.png" mode="" style="width: 25px;height: 25px;"></image>
						<text style="opacity: 0;">{{ unloading[unloadings] }}</text>
					</picker>
				</view>
			</view>
		</view>
		<!-- 下半部分 -->
		<view class="pagenumber">
			<!-- 单价 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;">
				<view class="place">
					<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
					<text style="margin-left: 5px;font-size:15px;">单价</text>
				</view>
				<view class="" style="display: flex;margin-right: 15px;">
					<input type="text" style="width:65px ; margin-right: 8px;" v-model="pric" placeholder="¥0.00" />
					<picker class="Choice" :range="prices" @change="priceChange" style="width: 50px;">{{ prices[Priced] }}</picker>
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 数量 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;" v-if="numshow">
				<view class="place">
					<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
					<text style="margin-left: 5px;font-size:15px;">数量</text>
				</view>
				<view style="margin-right: 15px; padding-right:0;  font-size:15px;display: flex;">
					<!-- <rich-text :nodes="nodes"></rich-text> -->
					<input type="text" style="width:75px ; margin-right: 8px;margin-top: -0.2px;" v-model="numbered" placeholder="请输入数量" />
					<text>{{ Company }}</text>
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 货物类型 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;">
				<view class="place"><text style="margin-left: 5px;font-size:15px;">货物类型</text></view>
				<view style="display: flex;margin-right: 15px; ">
					<picker class="Choice" :range="goodse" @change="ongoods" style="width: 106px;">
					<text v-if="goodse[goods]=='无'">请选择货物类型</text>
					<text v-if="goodse[goods]!='无'">	{{ goodse[goods] }}</text>
					</picker>
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 浮动费用 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;">
				<view class="place"><text style="margin-left: 5px;font-size:15px;">浮动费用</text></view>
				<view style="margin-right: 15px; padding-right:0;  font-size:15px;display: flex;">
					<!-- <rich-text :nodes="nodes"></rich-text> -->
					<input type="text" style="width:40px ; margin-right: 8px;margin-top: -1px;" v-model="plane" placeholder="¥0.00" />
					<text>元</text>
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 车型 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;">
				<view class="place"><text style="margin-left: 5px;font-size:15px;">车型</text></view>
				<view style="display: flex;margin-right: 15px; ">
					<picker class="Choice" :range="Vehicle" @change="Vehicled" style="width: 77px;">
					
					<text v-if="Vehicle[Vehicles]=='无'">请选择车型</text>
					<text v-if="Vehicle[Vehicles]!='无'">{{ Vehicle[Vehicles] }}</text>
					</picker>
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 车长 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;">
				<view class="place"><text style="margin-left: 5px;font-size:15px;">车长</text></view>
				<view style="display: flex;margin-right: 15px; ">
					<picker class="Choice" :range="Conductor" @change="Conductored" style="width: 77px;">
						<text v-if="Conductor[Conductors] == '无'">请选择车长</text>
						<text v-if="Conductor[Conductors] != '无'">{{ Conductor[Conductors] }}米</text>
					</picker>
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 备注 -->
			<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;">
				<view class="place"><text style="margin-left: 5px;font-size:15px;">备注</text></view>
				<view style="margin-right: 15px; padding-right:0;  font-size:15px;display: flex;">
					<!-- <rich-text :nodes="nodes"></rich-text> -->
					<input type="text" style="width:135px " placeholder="你还有什么特殊需求" />
					<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
				</view>
			</view>
			<!-- 银行卡 -->
			<view class="card" v-if="num == 1">
				<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;" @click="card">
					<view class="place"><text style="margin-left: 5px;font-size:15px;">绑定结算银行卡</text></view>
					<view style="margin-right: 15px; padding-right:0;  font-size:15px;display: flex;">
						<rich-text :nodes="nodes"></rich-text>
						<text style="color: #9B9B9B; font-size: 15px;">请选择绑定结算银行卡</text>
						<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
					</view>
				</view>
				<view>
					<view class="cards" v-if="mycard.name == undefined">暂未绑定结算银行卡</view>
					<view
						v-if="mycard.name != undefined"
						style="width: 355px;height: 120px;margin-top: 10px;margin-bottom: 10px;position: relative;display: flex;align-items: center;margin-left: 15px;"
					>
						<image src="../../static/img/bg_dk.png" style="width: 325px;height: 120px;" mode=""></image>
						<view class="cent" style="margin-top: 20px;height: 24px;position: absolute;top: 0px;width: 100%;">
							<text style="font-size: 18px;font-weight: 500;color: #042A58;margin-left: 20px">{{ mycard.name }}</text>
						</view>
						<view style="margin-top: 10px; font-size: 14px;color: #627995;margin-bottom: 20px;height: 14px;position: absolute;top: 41px;">
							<text style="margin-left: 20px;">{{ mycard.state }}</text>
							<text style="margin-left: 20px;">个人储蓄卡</text>
						</view>
						<text style="color: #627995;font-size: 18px;margin-left: 13px;height: 18px;position: absolute;top: 84px;left: 8px;">{{ mycard.Telephone }}</text>
					</view>
				</view>
			</view>
			<!-- 承运司机 -->
			<view class="cart" v-if="num == 1">
				<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;" @click="carted">
					<view class="place">
						<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
						<text style="margin-left: 5px;font-size:15px;">承运司机</text>
					</view>
					<view style="margin-right: 15px; padding-right:0;  font-size:15px;display: flex;">
						<!-- <rich-text :nodes="nodes"></rich-text> -->
						<text style="color: #9B9B9B; font-size: 15px;" v-if="mydata.name == undefined">请选择司机</text>
						<text style="color: #9B9B9B; font-size: 15px;" v-if="mydata.name != undefined">替换司机</text>
						<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
					</view>
				</view>
				<view>
					<view class="carts" v-if="mydata.name == undefined">暂未选择司机</view>
					<view class="carts" style="justify-content: space-between;" v-if="mydata.name != undefined">
						<view style="display: flex;justify-content: space-between;margin-left: 15px;">
							<view style="color: #042A58; font-size: 18px;">{{ mydata.name }}</view>
							<view style="margin-left: 20px;color: #627995;font-size: 16px;">
								<text v-if="mydata.state == 1">审核中</text>
								<text v-if="mydata.state == 2">认证失败</text>
								<text v-if="mydata.state == 3">已过期</text>
								<text v-if="mydata.state == 4">快过期</text>
								<text v-if="mydata.state == 5">已认证</text>
								<text v-if="mydata.state == ''">未知</text>
								<text v-if="mydata.state == null">认证失败</text>
							</view>
						</view>

						<view style="margin-right: 15px;color: #627995;font-size: 18px;">{{ mydata.Telephone }}</view>
					</view>
				</view>
			</view>
			<!-- 司机 -->
			<view class="card" v-if="num != 1">
				<view style="height: 55px; display: flex; align-items: center;justify-content: space-between;border: 1px solid #F5F5F5;" @click="carted">
					<view class="place">
						<text style="color:rgba(254,7,0,1);font-size:15px;">*</text>
						<text style="margin-left: 5px;font-size:15px;">承运司机</text>
					</view>
					<view style="margin-right: 15px; padding-right:0;  font-size:15px;display: flex;">
						<!-- <rich-text :nodes="nodes"></rich-text> -->
						<text style="color: #9B9B9B; font-size: 15px;" v-if="mydata.name == undefined">请选择司机</text>
						<text style="color: #9B9B9B; font-size: 15px;" v-if="mydata.name != undefined">替换司机</text>
						<image src="../../static/img/order/icon_youjian@2x.png" mode="" style="width: 19px; height: 19px;"></image>
					</view>
				</view>
				<view>
					<view class="cards" v-if="mydata.name == undefined">暂未选择司机</view>
					<view class="cards" style="justify-content: space-between;" v-if="mydata.name != undefined">
						<view style="display: flex;justify-content: space-between;margin-left: 15px;">
							<view style="color: #042A58; font-size: 18px;">{{ mydata.name }}</view>
							<view style="margin-left: 20px;color: #627995;font-size: 16px;">
								<text v-if="mydata.state==1">未认证</text>
								<text v-if="mydata.state==2">已认证</text>
								<!-- <text v-if="mydata.state == 3">已过期</text>
								<text v-if="mydata.state == 4">快过期</text>
								<text v-if="mydata.state == 5">已认证</text>
								<text v-if="mydata.state == ''">未知</text>
								<text v-if="mydata.state == null">认证失败</text> -->
							</view>
						</view>

						<view style="margin-right: 15px;color: #627995;font-size: 18px;">{{ mydata.Telephone }}</view>
					</view>
				</view>
			</view>
			<!-- 平台费用 -->
			<view
				style="width: 355px; height: 43px;
									display: flex;
									align-items: center;
									justify-content: space-between;
									font-size: 13px;
									color: #9B9B9B;
									"
			>
				<view>
					<!-- 平台将收取附加费,费率
					<text style="color: #FE0700;">6%</text> -->
				</view>
				<view>
					单笔总运费
					<text style="color: #FE0700;">{{ jisuweight | addZero }}</text>
				</view>
			</view>
			<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor="#007AFF"></simple-address>
			<simple-address ref="simpleAddresd" :pickerValueDefault="cityPickerValueDefaults" @onConfirm="onConfirmd" themeColor="#007AFF"></simple-address>
			<!-- 提交 -->
			<button
				style="width: 355px; height: 44px;
									display: flex;
									align-items: center;
									justify-content: space-around;
									color: #ffffff;
									font-size: 16px;
									background: #042A58;
									border-radius:8px;
									"
				@click="but"
			>
				提交订单
			</button>
		</view>
	</view>
</template>

<script>
import { ajax } from '../../api.js';
	import {HZajax} from "../../HZapi.js"
	import {ajaxs} from '../../apis.js';
import simpleAddress from '@/components/simple-address/simple-address.nvue';
export default {
	data() {
		return {
			num: '',
			cit: [],
			cits: [],
			xie: '',
			zhuang: '',
			citynum: '1',
			city: '',
			citys: '',
			// 地区选择
			cityPickerValueDefault: [0, 0, 1],
			cityPickerValueDefaults: [0, 0, 1],
			pickerText: '',
			// 单价
			pric: '',
			prices: ['元/吨', '元/方', '元/车'],
			Priced: 0,
			// 货物类型
			goodse: [
				'无',
				'钢铁',
				'煤炭',
				'泡沫',
				'蔬菜',
				'矿石',
				'建材',
				'有色金属',
				'配件',
				'木材',
				'粮食',
				'棉麻',
				'机械',
				'精密仪器',
				'纺织品',
				'百货',
				'电器',
				'其他'
			],
			goods: 0,
			// 车型
			Vehicle: ['无', '高栏车', '平板车', '冷藏车', '厢车', '挂车', '高地板', '特种车'],
			Vehicles: 0,
			// 车长
			Conductor: ['无', '4.2', '4.5', '5.2', '6.2', '6.8', '7.2', '7.6', '8.2', '9.6', '11.7', '12', '12.5', '13', '13.5', '14', '16', '17', '17.5', '18', '22'],
			Conductors: 0,
			// 装货地
			load: [],
			loading: ['请选择装货地'],
			loadings: 0,
			// 卸货地
			unloade: [],
			unloading: ['请选择卸货地'],
			unloadings: 0,
			// 司机
			mydata: '',
			// 银行卡
			mycard: '',
			// 数量
			numbered: '',
			// 浮动
			plane: '',
			add: '',
			// 单位
			Company: '吨',
			numshow: true
		};
	},
	components: {
		simpleAddress
	},
	
	// 分享
	onShareAppMessage: function(options) {
		var that = this; // 设置菜单中的转发按钮触发转发事件时的转发内容
		var shareObj = {
			title: '优货达货主', // 默认是小程序的名称(可以写slogan等)
			path: '', // 默认是当前页面，必须是以‘/’开头的完整路径
			imageUrl: '../../static/img/fenxiang.png' //自定义图片路径，可以是本地文件路径、代码包文件路径或者网络图片路径，支持PNG及JPG，不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
		}; // 返回shareObj
		return shareObj;
	},
	watch: {},
	computed: {
		jisuweight() {
			return (this.pric * this.numbered) / (94 / 100);
		}
	},

	filters: {
		addZero(data) {
			return Math.ceil(data.toFixed(3) * 100) / 100;
		}
	},
	methods: {
		card() {
			uni.navigateTo({
				url: '../card/card'
			});
		},
		// 地区选择
		openAddres2() {
			// 根据 label 获取
			var index = this.$refs.simpleAddress.queryIndex(['浙江省', '杭州市', '余杭区'], 'label');
			console.log(index);
			this.cityPickerValueDefault = index.index;
			this.$refs.simpleAddress.open();
		},
		openAddres3() {
			// 根据 label 获取
			var index = this.$refs.simpleAddresd.queryIndex(['浙江省', '杭州市', '萧山区'], 'label');
			this.cityPickerValueDefaults =  index.index;
			this.$refs.simpleAddresd.open();
		},
		onConfirm(e) {
			this.city = e.labelArr[0] + e.labelArr[1] + e.labelArr[2];
			this.cit = e.labelArr;
			this.zhuang = '';
		},
		onConfirmd(e) {
			this.citys = e.labelArr[0] + e.labelArr[1] + e.labelArr[2];
			this.cits = e.labelArr;
			this.xie = '';
		},
		// 下单
		carted() {
			uni.navigateTo({
				url: '../Driver/Driver'
			});
		},
		but() {
			uni.showLoading({
				title: '加载中'
			});
			var that = this;
			if (this.numbered != '' && this.pric != '' && this.mydata != '') {
				var that = this;
				var header;
				HZajax({
					url: '/v1/order/chuanHua/order/entrust',
					method: 'post',
					data: {
						// corpid:this.load[this.loadings-1].corp_id,
						// stationid: this.load[this.loadings-1].id,
						contactBankNo: this.mycard.Telephone,
						// startstationid:this.load[this.loadings-1].id,
						startstationname: this.zhuang,
						// sendUnit: this.load[this.loadings-1].customer,
						sendPerson: this.zhuang,
						// sendTel: this.load[this.loadings-1].tel,
						sendAddress: this.city + this.zhuang,

						// endstationid: this.unloade[this.unloadings-1].id,
						endstationname: this.xie,
						// receiveUnit:this.unloade[this.unloadings-1].customer,
						receivePerson: this.xie,
						// receiveTel: this.unloade[this.unloadings-1].tel,
						receiveAddress: this.citys + this.xie,

						contactIdCard: this.mydata.id,
						contacttel: this.mydata.Telephone,
						contactname: this.mydata.name,
						shipProvince: this.cit[0],
						shipCity: this.cit[1],
						shipCounty: this.cit[2],
						shipAddress: this.zhuang,
						placeProvince: this.cits[0],
						placeCity: this.cits[1],
						placeCounty: this.cits[2],
						placeOfReceipt: this.xie,
						goodsTypeName: this.goodse[this.goods],
						goodsWeightName: this.Company,
						piece: this.numbered,
						unitPrice: this.pric,
						totalPrice: this.pric * this.numbered,
						esfee:this.pric * this.numbered,
						estransportfee:this.pric * this.numbered,
						estakefee:0,
						essendfee:0,
						esotherfee1:0,
						esotherfee2:0,
						typereceipt:this.pric * this.numbered,
					},
					success(res) {
						console.log(that.cit[1])
						if (res.data.status == 'OK') {
							ajaxs({
								url: '/v1/address/add',
								method: 'post',
								data: {
									addresstype: 1,
									defaultstatus: 1,
									address: that.zhuang,
									province:that.cit[0],
									city: that.cit[1],
									county: that.cit[2]
								},
								success(res) {
								}
							});
							ajaxs({
								url: '/v1/address/add',
								method: 'post',
								data: {
									addresstype: 2,
									defaultstatus: 1,
									address: that.xie,
									province: that.cits[0],
									city: that.cits[1],
									county: that.cits[2	]
								},
								success(res) {
								}
							}),
								uni.hideToast();
							uni.reLaunch({
								url: '../Order/Order'
							});
						} else if (res.data.message == '当前司机, 手机号:' + that.mydata.Telephone + '已被指派') {
							uni.showToast({
								title: '当前司机, 手机号' + that.mydata.Telephone + '已被指派', // 标题
								icon: 'none'
							});
						} else {
							uni.showToast({
								title:res.data.message, // 标题
								icon: 'none'
							});
						}

						//请求成功的处理
					}
				});
			} else {
				// console.log("abc")
				uni.showToast({
					title: '请输入正确信息',
					icon: 'none'
				});
			}
			// uni.switchTab({
			// 	url:"../Order/Order"
			// })
			// console.log(this.goodse[this.goods])
		},
		// 单价
		priceChange: function(e) {
			//获得对象的 detail的 value
			//通过数组的下标改变显示在页面的值
			this.Priced = e.detail.value;
			if (this.prices[this.Priced] == '元/方') {
				this.Company = '方';
				this.numshow = true;
				this.numbered = '';
			} else if (this.prices[this.Priced] == '元/吨') {
				(this.Company = '吨'), (this.numbered = ''), (this.numshow = true);
			} else if (this.prices[this.Priced] == '元/车') {
				this.Company = '车';
				(this.numbered = 1), (this.numshow = false);
			}
		},
		// 货物类型
		ongoods(e) {
			this.goods = e.detail.value;
		},
		// 车型
		Vehicled(e) {
			this.Vehicles = e.detail.value;
		},
		// 车长
		Conductored(e) {
			this.Conductors = e.detail.value;
		},
		// 装货地
		loadinged(e) {
			this.loadings = e.detail.value;
			this.zhuang = this.loading[this.loadings];
			this.city = this.load[this.loadings - 1].province + this.load[this.loadings - 1].city + this.load[this.loadings - 1].county;
			this.cit = [
				this.load[this.loadings - 1].province,
				this.load[this.loadings - 1].city,
				 this.load[this.loadings - 1].county
			];
		},
		// 卸货地
		unload(e) {
			this.unloadings = e.detail.value;
			this.xie = this.unloading[this.unloadings];
			this.citys = this.unloade[this.unloadings - 1].province + this.unloade[this.unloadings - 1].city + this.unloade[this.unloadings - 1].county;
			this.cits = [
				 this.unloade[this.unloadings - 1].province,
				 this.unloade[this.unloadings - 1].city,
				 this.unloade[this.unloadings - 1].county
			];
		}
	},

	onShow() {
		var that = this;
		var pages = getCurrentPages();
		var currPage = pages[pages.length - 1]; //当前页面
		let json = currPage.data.mydata;
		console.log(json)
		//为传过来的值

		this.mydata = json;

		var that = this;
		var pages = getCurrentPages();
		var currPage = pages[pages.length - 1]; //当前页面
		let son = currPage.data.mycard;

		//为传过来的值

		this.mycard = son;
	},

	onLoad() {
		var that = this;
		uni.getStorage({
			key: 'name',
			success(res) {
				ajax({
					url: '/v1/user/getInfo?loginname=' + res.data[1],
					method: 'post',
					success(res) {
						console.log(res)
						that.num = res.data.message.isBind;
					}
				});
			}
		}),
			uni.getStorage({
				key: 'cart',
				success(res) {
					that.add = res.data;
				}
			});


		// 装车
		ajaxs({
			url: '/v1/address/list',
			method: 'post',
			data: { addresstype: 1,
			 offset: 1,
			 limit: 20,
			 },

			success(res) {
				//     请求成功的处理
				res.data.list.forEach(function(item, index) {
					that.load.push(item);
					// console.log(that.load)
					that.loading.push(item.address);
				});
			}
		})
			// 卸车
			ajaxs({
				url: '/v1/address/list',
				method: 'post',
				data: { addresstype: 2,
				 offset: 1,
				 limit: 20,
				 },

				success(res) {
					//     请求成功的处理
					res.data.list.forEach(function(item, index) {
						that.unloade.push(item);
						that.unloading.push(item.address);
					});
				}
			});
	}
};
</script>

<style>
page {
	height: 152%;
}
.pageaddress {
	width: 355px;
	height: 111px;
	background: rgba(255, 255, 255, 1);
	border-radius: 8px;
	margin-top: 10px;
}
.place {
	display: flex;
	align-items: center;
	margin-left: 15px;
}
.pagenumber {
	width: 355px;
	height: 391px;
	background: rgba(255, 255, 255, 1);
	border-radius: 8px;
	margin-top: 10px;
}
.Choice {
	width: 90px;
	height: 15px;
	font-size: 15px;
	font-weight: 400;
	color: rgba(155, 155, 155, 1);
	text-align: right;
}
.cart {
	width: 355px;
	height: 146px;
	background: rgba(255, 255, 255, 1);
	border-radius: 8px;
	margin-top: 10px;
}
.carts {
	width: 325px;
	height: 60px;
	background-image: url(../../static/img/bg_dkone.png);
	background-size: 325px 120px;
	background-repeat: no-repeat;
	margin-top: 15px;
	margin-left: 15px;
	font-size: 18px;
	font-weight: 500;
	color: rgba(4, 42, 88, 1);
	display: flex;
	align-items: center;
	justify-content: space-around;
}
.card {
	width: 355px;
	height: 206px;
	background: rgba(255, 255, 255, 1);
	border-radius: 8px;
	margin-top: 10px;
}
.cards {
	width: 325px;
	height: 120px;
	background-image: url(../../static/img/bg_dk.png);
	background-size: 325px 120px;
	background-repeat: no-repeat;
	margin-top: 15px;
	margin-left: 15px;
	font-size: 18px;
	font-weight: 500;
	color: rgba(4, 42, 88, 1);
	display: flex;
	align-items: center;
	justify-content: space-around;
}
input{
	text-align: right;
}
</style>
